package SearchStudent;

import java.util.Scanner;

/**
 * @Author MDD
 * @Description
 * @Version
 * @Date
 **/
public class TestStudent {
    public static void main(String[] args) {
        Student1 mgr = new Student1();
        Scanner sc = new Scanner(System.in);

        for (int i = 0; i < 5; i++) {
            System.out.print("请输入第"+(i+1)+"个学员的姓名：");
            String name = sc.next();
            mgr.addName(name);
        }
        mgr.showName();
        System.out.print("请输入要查找范围的开始位置：");
        int start = sc.nextInt();
        System.out.print("请输入要查找范围的结束位置：");
        int end = sc.nextInt();
        System.out.print("请输入要查找范围的学生姓名：");
        String name = sc.next();
        boolean flag = mgr.searchName(start,end,name);
        if (flag){
            System.out.println("该范围有您要查找的学生!");
        }else {
            System.out.println("该范围没有您要查找的学生!");
        }
    }
}
